package com.xjy.headfirst.迭代器;

import java.util.ArrayList;

/**
 * decription:
 *
 * @author 辛纪元
 * @since 2022-07-15
 */

public class PancakeHouseMenu {

    ArrayList<MenuItem> menuItems;

    public PancakeHouseMenu() {
        menuItems = new ArrayList<>();
        addItem("xjy", "辛", true, 1.1);
        addItem("jy", "金", false, 2.2);
    }

    void addItem(String name, String description, boolean vegetarian, double price) {
        MenuItem menuItem = new MenuItem(name, description, vegetarian, price);
        menuItems.add(menuItem);
    }

//    public ArrayList<MenuItem> getMenuItems(){
//        return menuItems;
//    }

    public Iterator createIterator() {
        return new PancakeHouseMenuIterator(menuItems);
    }

}
